import Mock from 'mockjs'

const Random = Mock.Random

Mock.mock('/homepage/coding', 'post', ({ body }) => {
    var data = eval("(" + body + ")").body
    let result = Mock.mock({
        ' data|10': [
            data
        ]
    })
    return {
        type: 1,
        code: 200,
        msg: '请求成功',
        ...result,
    }
})


Mock.mock('/class/content', 'post', ({ body }) => {
    var data = eval("(" + body + ")").body;

    let result = Mock.mock({
        'data|10': [
            data
        ]
    })
    return {
        type: 1,
        code: 200,
        msg: '请求成功',
        ...result,
    }
})
Mock.mock('/free/content', 'post', ({ body }) => {
    var data = eval("(" + body + ")").body;

    let result = Mock.mock({
        'data|10': [
            data
        ]
    })
    return {
        type: 1,
        code: 200,
        msg: '请求成功',
        ...result,
    }
})



Mock.mock('/read/content', 'post', ({ body }) => {
    var data = eval("(" + body + ")").body;

    let result = Mock.mock({
        'data|30': [
            data
        ]
    })
    return {
        type: 1,
        code: 200,
        msg: '请求成功',
        ...result,
    }
})




Mock.mock('/detail/content', 'post', ({ body }) => {
    var data = eval("(" + body + ")").body;

    let result = Mock.mock({
        'data|1': [
            data
        ]
    })
    return {
        type: 1,
        code: 200,
        msg: '请求成功',
        ...result,
    }
})